package com.wanwu.channel.common.enums;

public enum WeixinTradeStatusEnums {

    SUCCESS("SUCCESS", "支付成功"),
    USERPAYING("USERPAYING", "用户支付中"),
    REFUND("REFUND", "转入退款"),
    NOTPAY("NOTPAY", "未支付"),
    CLOSED("CLOSED", "已关闭"),
    REVOKED("", "已撤销（刷卡支付）"),
    PAYERROR("PAYERROR", "支付失败(其他原因，如银行返回失败)"),


    ;

    private String code;
    private String desc;

    WeixinTradeStatusEnums(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static WeixinTradeStatusEnums getTradeStatusEnum(String code) {
        for (WeixinTradeStatusEnums v : WeixinTradeStatusEnums.values()) {
            if (code.equals(v.getCode())) {
                return v;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
